<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
    <script src="layui/layui.js"></script>
</head>


<body class="layui-layout-body">


<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">后台对账系统</div>
        <ul class="layui-nav layui-layout-right">
        </ul>
    </div>

    <div class="layui-side layui-side-menu">
        <!--带滚动条垂直导航-->
        <div class="layui-side-scroll layui-bg-black">
            <div class="layui-logo">后台管理系统</div>
            <ul class="layui-nav layui-nav-tree" lay-filter="navtree">
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;" title="用户"><cite>对账信息</cite></a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" lay-href="list.html" >公众号交易查询</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" lay-href="mylist.html" >院内交易查询</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" lay-href="tools.html" >其他</a></dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>

    <div class="layui-body" style="bottom: 1px">

        <div class="layui-tab" lay-filter="pagetabs" lay-allowclose="true" style="margin:0 0;">
            <ul class="layui-tab-title">
                <li class="layui-this" lay-id="11">主页</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe src="" style="width: 100%;height: 100%" class="layui-admin-iframe" scrolling="no" frameborder="0"></iframe>
                </div>
            </div>
        </div>

    </div>
    <script>
        layui.use(['element','layer'],function(){
            var element = layui.element
                ,layer = layui.layer
                ,$ = layui.jquery;

            function aa(){
                //$.get("xxxsasasad/asdas");
            }
            aa();

            //左侧垂直菜单监控
            element.on('nav(navtree)',function(elem){
                if($(".layui-side-menu").width()<200){
                    $(".layui-side-menu").animate({width:$(".layui-side-menu").width()+144+"px"});
                    $(".layui-body").animate({left:$(".layui-body").position().left+144+"px"});
                    $(".layui-footer").animate({left:$(".layui-footer").position().left+144+"px"});
                    $(".layui-layout-left li:first-child").find("a").attr("class","hidetab");
                    $(".layui-layout-left li:first-child").find("i").attr("class","layui-icon layui-icon-shrink-right");
                    $(".layui-nav-tree").find("li").each(function(em,ind){
                        $(this).find("cite").css("display","");
                        $(this).find("dl").css("display","");
                    });
                }else{
                    if($(this).attr("lay-href")!=undefined){
                        var  flag = true;
                        //url
                        var url = $(this).attr("lay-href");

                        //判断选项卡中是否存在已打开的页面，如果有直接切换到打开页面
                        $(".layui-tab-title li").each(function(i,e){
                            if($(this).attr("lay-id")==url){
                                //切换选项卡
                                element.tabChange('pagetabs', url);
                                flag = false;
                            }
                            //tab做了操作就更新tab的高度
                            var h=window.screen.height;
                            $(".layui-show").css("height",h);

                        })
                        if(flag){
                            //新增选项卡
                            element.tabAdd('pagetabs', {
                                title: elem[0].innerText
                                ,content: '<iframe src="'+url+'" class="layui-admin-iframe" scrolling="auto" frameborder="0" style="width: 100%;height: 100%"></iframe>'
                                ,id: url
                            });
                            //切换选项卡
                            element.tabChange('pagetabs', url);
                            //tab做了操作就更新tab的高度
                            var h=window.screen.height;
                            $(".layui-show").css("height",h);
                        }
                    }
                }
            });
        });
    </script>

</div>

</body>

</html>